﻿using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Formatting;


namespace BasicallyNot.CodeTransformers.Handlers
{

	internal class BeginAndEndBlock : IVisualHandler
	{

		private IVisualHandler _beginBlock;
		private IVisualHandler _endBlock;

		internal BeginAndEndBlock()
		{
			_beginBlock = new BeginBlock();
			_endBlock = new EndBlock();
		}

		void IVisualHandler.Handle( VisualHandlerEventArg arg )
		{
			// set opacity of the current brush to 100 percent
			arg.KeywordForeground = arg.KeywordForeground.Clone();
			arg.KeywordForeground.Opacity = 1.0;

			// do both!
			_beginBlock.Handle( arg );
			_endBlock.Handle( arg );
		}

	}

}
